﻿using System;

namespace SerialPortWindow
{
    public class P7SerialPortMessage
    {
        public int LeftTopPressure { get; set; }  //左上压力
        public int LeftBottomPressure { get; set; } //左下压力
        public int RightTopPressure { get; set; } //右上压力
        public int RightBottomPressure { get; set; } //右下压力
        public int RightReinPull { get; set; } //右缰拉力
        public int LeftReinPull { get; set; } //左缰拉力
        public int emergencyStop { get; set; }

        public int TopSumPressure => Math.Max(1, LeftTopPressure + RightTopPressure);
        public int BottomSumPressure => Math.Max(1, LeftBottomPressure + RightBottomPressure);
        public int LeftSumPressure => Math.Max(1, LeftTopPressure + LeftBottomPressure);
        public int RightSumPressure => Math.Max(1, RightTopPressure + RightBottomPressure);
        public int TotalPressure => Math.Max(1, RightTopPressure + RightBottomPressure + LeftTopPressure + LeftBottomPressure);
        public int ReinPullSum => Math.Max(1, LeftReinPull + RightReinPull);

        public P7SerialPortMessage()
        {
            LeftReinPull = 0;
            RightReinPull = 0;
            LeftTopPressure = 0;
            LeftBottomPressure = 0;
            RightTopPressure = 0;
            RightBottomPressure = 0;
        }
    }
}
